package com.kins.so.knowledgebase.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @Description:
 * @Author: 申科
 * @Date:2025/11/12 16:13
 */
@Data
public class RagflowLibrary implements Serializable {
    private String libraryId;

    private String categoryCode;

    private String libraryName;

    private String description;

    private String documentCount;

    private String state="1";

    private String permissionType;

    private String id;

    private String createBy;

    private String createByName;

    private Date createDate;

    private String updateBy;

    private String updateByName;

    private Date updateDate;

    private String languages;

    private String typeCode;

    private Boolean isSource;

    private Boolean isGeneral;

    private String isoutsideKb;

    private String certNo;

    private String custName;

    private String custType;

    private String custNo;

    @TableField(exist=false)
    public int pageNum = 0;

    @TableField(exist=false)
    public int pageSize = 10;

    @TableField(exist=false)
    public String orderBy;

    @TableField(exist=false)
    public String userNum;

    @TableField(exist=false)
    public String orgCode;

    public String belongOrgCode;

    @TableField(exist=false)
    public List<String> orgCodeList;

    @TableField(exist=false)
    public String orgName;

    @TableField(exist=false)
    public String orgLevelCd;

    @TableField(exist=false)
    public String fileType;

    @TableField(exist=false)
    public String businessNo;

    @TableField(exist=false)
    public List<String> categoryCodeList;

    public void preInsert(String userName){
        this.setId(IdWorker.getId()+"");
        this.setCreateDate(new Date());
        this.setUpdateDate(new Date());
        this.setCreateBy(userName);
        this.setUpdateBy(userName);
    }

    public void preUpdate(String userName){
        this.setUpdateDate(new Date());
        this.setUpdateBy(userName);
    }
}
